home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / FROMUTS / DRAWPLUS2 / docs / tech < prev   
Text File  |  1991-04-17  |  5KB  |  128 lines

  1.  
  2.  
  3.                        DRAW PLUS TECHNICAL DETAILS
  4.  
  5.                              © JJM April 1991
  6.  
  7.  
  8.  
  9. This  file  gives  details  of the  additional  data  structures  used  by 
  10. Draw Plus.   They  are defined in terms of C structures.   Details of  the 
  11. standard  types and objects can be found in the include file  drawftypes.h 
  12. supplied with C release 3.  Any future changes to these structures will be 
  13. backwards compatible with Draw Plus version 2·00.
  14.  
  15.  
  16.  
  17. Extended object tag
  18.  
  19. This  replaces the 4-byte object tag used in standard  Draw  objects,  and 
  20. stores the layer information and miscellaneous flags.  The default for the 
  21. extended  information  is all zeros,  which means that objects  and  files 
  22. without  this  information are fully compatible  with  other  applications 
  23. which produce or use Draw files.
  24.  
  25. The extended tag is described by the following structure:
  26.  
  27.   typedef unsigned char draw_tagtyp;
  28.   typedef unsigned char draw_layer;
  29.   typedef unsigned char draw_objflags;
  30.  
  31.   struct draw_extag               /* Extended object tag */
  32.   {
  33.           draw_tagtyp tag;        /* Basic object type */
  34.           draw_layer layer;       /* Drawing layer, 0 to 31 */
  35.           draw_objflags flag;     /* Object flags */
  36.           unsigned char spare;    /* For future expansion */
  37.   };
  38.  
  39. The following bits in flag are used at present:
  40.  
  41.   #define flag_NODISPLAY     1    /* Object is never displayed */
  42.   #define flag_LOCKED        2    /* Object is locked */
  43.   #define flag_HIDDEN        4    /* Object is temporarily hidden */
  44.  
  45. The NODISPLAY flag is used to mark objects,  such as saved settings,  used 
  46. internally.  The HIDDEN flag marks objects that are temporarily invisible, 
  47. such as path objects that are in the process of being edited.   The LOCKED 
  48. flag is set if the object has been locked.
  49.  
  50. The  extended tag replaces the original draw_tagtyp in the object  header, 
  51. as follows:
  52.  
  53.   struct draw_objhdr              /* General object header */
  54.   {
  55.           draw_extag t;           /* Extended tag */
  56.           draw_sizetyp size;      /* Object size */
  57.           draw_bboxtyp bbox;      /* Bounding box */
  58.   };
  59.  
  60.  
  61.  
  62. Saved settings
  63.  
  64. Settings,  styles, layer and dash pattern information is saved in a number 
  65. of objects which are described by the following structure:
  66.  
  67.   struct draw_setstrhdr           /* Saved settings object header */
  68.   {
  69.           draw_extag t;           /* Extended tag */
  70.           draw_sizetyp size;      /* Object size */
  71.           draw_bboxtyp bbox;      /* Bounding box */
  72.           int version;            /* Structure version */
  73.           int contents;           /* What this contains */
  74.   };
  75.  
  76. The  settings  structure version field is used to detect  incompatible  or 
  77. out-of-date settings;  it is currently 4.
  78.  
  79. The contents field indicates what is stored in this structure.   The types 
  80. currently defined are:
  81.  
  82.   #define set_USER           1    /* General user settings */
  83.   #define set_TEXTSTYLE      2    /* Default text style */
  84.   #define set_PATHSTYLE      3    /* Default path style  */
  85.   #define set_EXTRAS         4    /* Layers and dash patterns */
  86.   #define set_EXPAND         5    /* For future expansion */
  87.  
  88. The data immediately follows this structure.  Since the format and content 
  89. is subject to change,  details are not included here.  The object type for 
  90. a saved settings object is 101.
  91.  
  92.  
  93.  
  94. Library file
  95.  
  96. The  library  file format is very similar to a standard  Draw  file.   The 
  97. header  is identical,  except that the creator string is "Library"  rather 
  98. than "Draw".  The major version number is 2.
  99.  
  100. The  rest  of  the file contains standard Draw objects  described  by  the 
  101. following structures:
  102.  
  103.   struct draw_libstrhdr           /* Library object header */
  104.   {
  105.           draw_extag tag;         /* Object tag */
  106.           draw_sizetyp size;      /* Size (including contained object) */
  107.           draw_bboxtyp bbox;      /* Copy of object's bounding box */
  108.           char name[21];          /* Object name */
  109.           time_t time;            /* Time last updated */
  110.   };
  111.  
  112. The  included  object  (with  its  own  tag  and  bounding  box)   follows 
  113. immediately after the header:
  114.  
  115.   struct draw_libstr              /* Library object */
  116.   {
  117.           draw_extag tag;         /* Object tag */
  118.           draw_sizetyp size;      /* Size (including contained object) */
  119.           draw_bboxtyp bbox;      /* Copy of object's bounding box */
  120.           char name[21];          /* Object name */
  121.           time_t time;            /* Time last updated */
  122.           draw_objhdr object;     /* Object data */
  123.   };
  124.  
  125. The type time_t is defined in the header file time.h.  The object type for 
  126. a library object is 100.
  127.  
  128.